
RewriteOptions inherit
# Uncomment this on a live site
#<IfModule mod_headers.c>
#    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
#        Header set Cache-Control "max-age=604800, public"
#    </FilesMatch>
#</IfModule>
#Disable Directory Browsing
#Options All -Indexes
<IfModule mod_rewrite.c>
  SetEnv HTTP_MOD_REWRITE On
	RewriteEngine On
  Options +SymLinksIfOwnerMatch
  # Redirect HTTP with www to HTTPS without www
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]
  # Redirect HTTP without www to HTTPS without www
  RewriteCond %{HTTPS} off
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  # Redirect HTTPS with www to HTTPS without www
  RewriteCond %{HTTPS} on
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule .* https://%1%{REQUEST_URI} [R=301,L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*) index.php?url=$1 [L,QSA]
</IfModule>
# Block Access to .ini, .db, .sql, .htaccess Files
<FilesMatch "(^.*\.([Ii][Nn][Ii]|[Dd][Bb]|[Ss][Qq][Ll]|[Hh][Tt][Aa])|~)$">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>
